package us.wili.dev.common.util.xinge.v2.model.req.ios;

import com.alibaba.fastjson.JSONObject;
import org.springframework.util.CollectionUtils;

import java.util.Map;

/**
 * author: lefore
 * date: 2018/8/30
 */
public class IOSMsg {

    private Aps aps;
    private Map<String, Object> customContent;

    public String toJson() {
        JSONObject jsonObj;
        if (!CollectionUtils.isEmpty(customContent)) {
            jsonObj = new JSONObject(customContent);
        } else {
            jsonObj = new JSONObject();
        }
        jsonObj.put("aps", aps);
        return jsonObj.toJSONString();
    }

    public Aps getAps() {
        return aps;
    }

    public void setAps(Aps aps) {
        this.aps = aps;
    }

    public Map<String, Object> getCustomContent() {
        return customContent;
    }

    public void setCustomContent(Map<String, Object> customContent) {
        this.customContent = customContent;
    }
}
